﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EquipmentManager.Dtos
{

    using GTS.Foundation;
    using ServiceStack;
    using ServiceStack.OrmLite;
    public class User : EditableObject
    {
        public string Name { get; set; }
        public string PassWord { get; set; }
        public string PowerType { get; set; }
    }
    #region 登录和登出

    [Route("/userlogin", Verbs = "POST")]
    public class UserLogin
    {
        public string UserName { get; set; }
        public string PassWord { get; set; }
        public int MinutesOfTimeout { get; set; }
    }
    public class UserLoginResponse : IHasResponseStatus
    {
        public string SessionID { get; set; }
        public ResponseStatus ResponseStatus { get; set; }
    }
    [Route("/userlogin", Verbs = "DELETE")]
    public class UserLogout
    {
        public string SessionID { get; set; }
    }
    public class UserLogoutResponse : IHasResponseStatus
    {
        public ResponseStatus ResponseStatus { get; set; }
    } 
    #endregion

    [Route("/Users", Verbs = "GET")]
    [Route("/Users/{Id}", Verbs = "GET")]
    public class GetUsers
    {
        public int Id { get; set; }
        public string Filter { get; set; }

    }
    public class GetUsersResponse : IHasResponseStatus
    {
        public List<User> Entities { get; set; }
        public ResponseStatus ResponseStatus { get; set; }
    }

    [Route("/Users", Verbs = "POST")]
    public class PostUser
    {
        public User Entity { get; set; }
    }
    public class PostUserResponse : IHasResponseStatus
    {
        public int Id { get; set; }
        public ResponseStatus ResponseStatus { get; set; }
    }

    [Route("/Users/{Id}", Verbs = "DELETE")]
    public class DeleteUser
    {
        public int Id { get; set; }
    }
    public class DeleteUserResponse : IHasResponseStatus
    {
        public ResponseStatus ResponseStatus { get; set; }
    }
}
